#include <iostream>
#include <fstream>

using namespace std;

int main(int argc, char* const* argv)
{
  for(int i = 1; i < argc; i++)
  {
    FILE *f = fopen(argv[i], "r");
    int count = 0;
    double value;
    double sum = 0;
    double max = 0;
    while(fscanf(f, "%lf", &value) != EOF)
    {
      if(value > max)
        max = value;
      sum = sum + value;
      count++;
    }
    cout << "Stats for " << argv[i] << endl;
    cout << "average: " << sum/count << endl;
    cout << "max: " << max << endl;
    cout << "sample size: " << count << endl << endl;
    fclose(f);
  }
  return 0;
}

